﻿<UserControl x:Class="DaphneControls.InternalEngineSettings"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             xmlns:loc="http://schemas.tomer.com/winfx/2006/xaml/presentation"                        
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*" />
            <ColumnDefinition Width="1*" />
        </Grid.ColumnDefinitions>

        <Label Grid.Row="0" Grid.Column="0" Content="{loc:Translate Default='Search algorithm:'}" />
        <ComboBox x:Name="uxSearch" Grid.Row="0" Grid.Column="1" Width="100" Margin="5" ItemsSource="{Binding Path=SearchTypes}" SelectedValue="{Binding Path=SelectedSearch}"/>

        <Label Grid.Row="1" Grid.Column="0" Content="{loc:Translate Default='Maximum depth:'}" />
        <TextBox x:Name="uxDepth" Margin="5" Grid.Row="1" Grid.Column="1" Width="100" Text="{Binding Path=Depth, StringFormat=n, Mode=TwoWay}">            
            <TextBox.Style>
                <Style TargetType="TextBox">
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding ElementName=uxSearch, Path=SelectedValue.Depth}" Value="False">
                            <Setter Property="IsEnabled" Value="False" />
                        </DataTrigger>
                    </Style.Triggers>
                </Style>                
            </TextBox.Style>
        </TextBox>

        <Label Grid.Row="2" Grid.Column="0" Content="{loc:Translate Default='Time in seconds:'}" />
        <TextBox Margin="5" Grid.Row="2" Grid.Column="1" Width="100" Text="{Binding Path=Time, StringFormat=n, Mode=TwoWay}">
            <TextBox.Style>
                <Style TargetType="TextBox">
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding ElementName=uxSearch, Path=SelectedValue.Depth}" Value="True">
                            <Setter Property="IsEnabled" Value="False" />
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </TextBox.Style>
        </TextBox>

        <Label Grid.Row="3" Grid.Column="0" Content="{loc:Translate Default='Transposition tables:'}" />
        <CheckBox Grid.Row="3" Grid.Column="1" HorizontalAlignment="Center" Margin="5"
                  IsChecked="{Binding Path=UseTT, Mode=TwoWay}" />

        <Label Grid.Row="4" Grid.Column="0" Content="{loc:Translate Default='Probing tablebases:'}" />
        <CheckBox Grid.Row="4" Grid.Column="1" HorizontalAlignment="Center" Margin="5" 
                  IsChecked="{Binding Path=UseEndGame, Mode=TwoWay}" />

        <Label Grid.Row="5" Grid.Column="0" Content="{loc:Translate Default='Use Killer Moves:'}" />
        <CheckBox Grid.Row="5" Grid.Column="1" HorizontalAlignment="Center" Margin="5" 
                  IsChecked="{Binding Path=UseKillerMoves, Mode=TwoWay}" />

        <Label Grid.Row="6" Grid.Column="0" Content="{loc:Translate Default='Use History Heuristics:'}" />
        <CheckBox Grid.Row="6" Grid.Column="1" HorizontalAlignment="Center" Margin="5" 
                  IsChecked="{Binding Path=UseHistoryHeuristics, Mode=TwoWay}" />

        <Label Grid.Row="7" Grid.Column="0" Content="{loc:Translate Default='Use Position Strategy:'}" />
        <CheckBox Grid.Row="7" Grid.Column="1" HorizontalAlignment="Center" Margin="5" 
                  IsChecked="{Binding Path=UsePositionStrategy, Mode=TwoWay}" />

        <Label Grid.Row="8" Grid.Column="0" Content="{loc:Translate Default='Cache Size in MB:'}" />
        <TextBox Margin="5" Grid.Row="8" Grid.Column="1" Width="100" Text="{Binding Path=CacheSizeMB, StringFormat=n, Mode=TwoWay}">
        </TextBox>

    </Grid>
</UserControl>
